package com.chagee.store.operation.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 0 - 待验真 ; 1 - 验真中 2 - 验真成功  3- 验真失败; 4- 无需验真
 * @Author : hk
 * @Date : 2024/12/18
 */
@Getter
@AllArgsConstructor
public enum InvoiceCheckStatusEnum {

	AWAIT_EXAMINE("0", "待验真"),
	EXAMINE_MIDWAY("1", "验真中"),
	TRUE_SUCCESS("2", "验真成功"),
	TRUE_LOSE("3", "验真失败"),
	DISPENSE_WITH_TRUE("4", "无需验真"),

	;

	private final String type;
	private final String desc;


	public static InvoiceCheckStatusEnum queryByType(String type) {
		for (InvoiceCheckStatusEnum value : values()) {
			if (Objects.equals(type, value.getType())) {
				return value;
			}
		}
		return null;
	}
}
